package cn.yunhe.util;

import cn.yunhe.biz.PhoneBiz;
import cn.yunhe.biz.PhoneImpl;
import cn.yunhe.exception.OutOfStockException;

public class LogProxyPhone implements PhoneBiz {
    private PhoneBiz phoneBiz=new PhoneImpl();
    private LogPhoneUtil logPhoneUtil=new LogPhoneUtil();

    @Override
    public void buyPhone(int num) {
        phoneBiz.buyPhone(num);
        logPhoneUtil.PhoneLog("购买",num);
    }

    @Override
    public void salePhone(int num) throws OutOfStockException {
        phoneBiz.salePhone(num);
        logPhoneUtil.PhoneLog("出售",num);
    }

}
